<template>
  <div>
    <slot></slot>
    {{ title1 }}
  </div>
</template>

<script>
export default {
  data() {
    return {
      value2:'我是子组件向父组件传的值'
    };
  },
  props: {
    title1: {
      type: String,
      default: "我是子组件自己的数据",
    },
  },
  mounted() {
    this.$emit("childToParent", this.value2);
  },
};
</script>

<style scoped></style>
